home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-03-09 | 2.1 KB | 54 lines | [TEXT/GEOL] |
- Item 6204448 5-March-90 06:34PST
-
- From: ROSENSTEIN1 Rosenstein, Larry
-
- To: MACAPP.TECH$ MacApp Technical
- POWERUP.DEV Power Up Software,PRT
-
- Sub: RE>Re- Save As PICT
-
- Attn: MacApp Tech
- Attn: Power Up Software,PRT
- SentBy: Larry Rosenstein
- Date 3/2/90
- Subject RE>Re- Save As PICT
- From Larry Rosenstein
- To MacApp Tech, Power Up Software,PRT
-
- Reply to: RE>Re- Save As PICT
- James,
-
- I think the fundamental routine is a view method that accepts a grafPort (or
- assumes that the current port is the grafPort) and draws the entire view to
- that grafPort. This would contain the parts of WriteToDeskScrap that put the
- view into the port and draw the view. It would know nothing about pictures.
-
- Then you could implement your ViewToPICT method that creates a port, draws the
- view within the port, checks for errors, etc. WriteToDeskScrap would call
- this and install the PictHandle into the scrap. Someone who wanted to do a
- simple kind of PICT file would call this and write the picture to the file.
- (This routine could be a global utility as you say.)
-
- It's not clear to me that TView should have methods to write PICT files
- directly to disk. What I would prefer (and have implemented) is the concept
- of a disk-based picture.
-
- Imagine a TWritePict class that has a method DoDrawing. You subclass
- TWritePict and override DoDrawing to draw whatever belongs in the picture.
- Then to create a PICT file you create an instance of this class and call the
- CreateDiskPicture method, passing it a file refnum. CreateDiskPicture sets up
- a private port, and eventually calls DoDrawing. A subclass that saves views,
- would call the method above that draws the view within a given port.
-
- (The opposite class is TReadPict that is initialized with a file refnum. You
- call the method DrawDiskPicture instead of DrawPicture to replay the picture
- directly from disk.)
-
- I prefer this approach because the concept of a disk-based picture stands on
- its own, and could be used in other cases. It doesn't makes sense to tie PICT
- files closely to a view.
-
- Larry Rosenstein
-
-
-